import time
import uuid
from datetime import datetime
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


def mock_generate_video(text: str) -> dict:
    """模拟视频生成（测试用）"""
    try:
        # 模拟处理耗时
        time.sleep(3)

        # 生成模拟视频URL
        video_id = str(uuid.uuid4())
        video_url = f"http://your-cdn.com/videos/{video_id}.mp4"

        logger.info(f"Generated video for text: {text}")

        return {
            "status": "success",
            "video_url": video_url,
            "debug_info": {
                "text": text,
                "timestamp": datetime.now().isoformat()
            }
        }
    except Exception as e:
        logger.error(f"Generation failed: {str(e)}")
        return {"status": "error", "message": str(e)}